package com.job.yangshida;

/**
 * @author 杨士达
 * @version 1.0
 * @since 2022-07-07 10:10:27
 */
public class STN0705 {
    public static void main(String[] args) {
        STN0705.stn(4, 8, 9);
    }
    //s start 起始数
    //t terminal 终止
    //n 行列数
    public static void stn(int s,int t,int n) {
        int[][] arr=new int[n][n];
        //按列存列
        for (int col=n-1;col>-1;col--){
            for (int row=0;row<=col;row++){
                arr[row][col]=s;
                s++;
                s=s>t?1:s;
            }
        }
        //打印
        for (int row=0;row<n;row++){
            //用if else也一样
            for (int col=0;col<row;col++){
                System.out.print("\t");
            }
            for (int col=row;col<n;col++){
                System.out.print(arr[row][col]+"\t");
            }
            System.out.println();
        }
    }
}
